# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2021年08月24日
"""
from docx.enum.section import WD_ORIENTATION # 纸张方向
from docx import Document
from docx.shared import Cm

file = Document('./练习/练习.docx') # 新建文档
sec1 = file.sections[0] # 获取第一个节
# 指定为横向,不能省略,否则尺寸变了但还是纵向
sec1.orentation = WD_ORIENTATION.LANDSCAPE
wh, ht = sec1.page_width, sec1.page_height
sec1.page_width = ht
sec1.page_height = wh


file.save('./练习/23结果03.docx')
